Repository navigation
Conversation
…custom one from shopinvader
Get rid of keychain dependency
Co-Authored-By: qgroulard <43472442+qgroulard@users.noreply.github.com>
Api key is now based on the new version of server env Key belong to a specifiv database that can be requested based on the domain name. Just setup the db_filter with "%d^" to filter based on domain name
… to manage auth api keys
Add a migration script to create the auth.api.key records from keys defined into the cfg file Provides a specific serction name builder to continue reading the key info from the same section as the one expected by the previous version
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: server-auth-19.0/server-auth-19.0-auth_api_key Translate-URL: https://translation.odoo-community.org/projects/server-auth-19-0/server-auth-19-0-auth_api_key/
Currently translated at 100.0% (25 of 25 strings) Translation: server-auth-19.0/server-auth-19.0-auth_api_key Translate-URL: https://translation.odoo-community.org/projects/server-auth-19-0/server-auth-19-0-auth_api_key/it/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: server-auth-19.0/server-auth-19.0-auth_api_key Translate-URL: https://translation.odoo-community.org/projects/server-auth-19-0/server-auth-19-0-auth_api_key/
Currently translated at 100.0% (26 of 26 strings) Translation: server-auth-19.0/server-auth-19.0-auth_api_key Translate-URL: https://translation.odoo-community.org/projects/server-auth-19-0/server-auth-19-0-auth_api_key/it/
The test creates its user with a 4 character password. That is fine for this module alone, but the OCA CI installs every module of the repository into a single database, and password_security depends on auth_password_policy_signup, hence on auth_password_policy, whose data file installs a minimum length of 8: - https://github.com/odoo/odoo/blob/13e9e827dc21103052e8607d16f23c07adeb5634/addons/auth_password_policy/data/defaults.xml#L5 so setUpClass fails with: UserError: Your password must contain at least 8 characters and only has 4. Checked with an A/B run: the module is green on its own and red as soon as password_security shares the database.
The pylint-odoo version of template v1.48 makes attribute-string-redundant (W8113) mandatory. The removed labels are the ones Odoo already generates from the field name, so the UI does not change.
|
The following commit authors need to sign the Contributor License Agreement: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migration changes
20.0.1.0.0.ir.model.access.csvto the newsecurity/ir.access.csv(same rights:base.group_system,crud)._auth_method_api_keynow takes theroutingargument passed byir.http._authenticate_explicit.Dispatcherfromodoo.http.dispatcher(no longer re-exported byodoo.http).registry.clear_cache()withenv.transaction.invalidate_ormcache()(model and tests).api.ormcacheinstead of deprecatedtools.ormcache.readme/CREDITS.md(past migration funding note), per 20.0 guidelines.Fix included
The API key lookup cache was only cleared when
keyoruser_idchanged, so a deleted or archived key could keep authenticating until the cache was cleared by something else. The model now uses_clear_cache_name/
_clear_cache_on_fields = ("key", "user_id", "active"), so the ORM clears the cache on create, unlink and on writes of those fields. Two tests added (archive, unlink).Known issues (pre-existing, not addressed here)
active = Falseon keys of already-archived users, but the recompute does not go throughwrite(), so a cached key keeps working until the cache is cleared. Note that the field help says the option is not retroactive, while the stored compute (dependson the company option) does make it retroactive —maintainers' input welcome on the intended behavior.
_compute_activereadsself.user_id.company_id.archived_user_disable_auth_api_keyon the whole recordset, which may raise "Expected singleton" when keys of users from different companies are recomputed together(not reproduced).
Tests
15 tests, 0 failures (local run).